package com.ice.work.moment.facade.user.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.honeybee.cloud.framework.common.page.Page;
import com.ice.work.moment.facade.user.dto.RoleDTO;
import com.ice.work.moment.facade.user.model.Role;
import com.ice.work.moment.facade.user.vo.RoleVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Collection;
import java.util.List;

/**
 * @Description RoleConvertMapper
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@Mapper
@SuppressWarnings("all")
public interface RoleConvertMapper {
    RoleConvertMapper INSTANCE = Mappers.getMapper(RoleConvertMapper.class);

    /**
     * Role 转 RoleDTO
     *
     * @param from
     * @return
     */
    RoleDTO toDTO(Role from);

    /**
     * Collection<Role> 转List<RoleDTO>
     *
     * @param from
     * @return
     */
    List<RoleDTO> toDTO(Collection<Role> from);

    /**
     * IPage<RoleDTO> to Page<RoleVO>
     *
     * @param from
     * @return
     */
    Page<RoleVO> toVO(Page<RoleDTO> from);

    /**
     * IPage<Role> to Page<RoleDTO>
     *
     * @param from
     * @return
     */
    Page<RoleDTO> toDTO(IPage<Role> from);
}
